package com.ChenYaRou.www.dao;

import com.ChenYaRou.www.po.Car;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 86183
 */
public interface CarDao {
    /**
     * 更新购物车状态
     * @param  newCar 新car
     * @param oldCar 旧car
     * @return 成功与否 操作条数
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int update(Car newCar,Car oldCar) throws IllegalAccessException, SQLException;

    /**
     * 新建购物单
     * @param car 新购物车单
     * @return 更新条数
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int insert(Car car) throws IllegalAccessException, SQLException ;


        /**
         * 从购物车中删除
         * @return 成功与否
         */
    boolean delete();

    /**
     * 查找car集合
     * @param car 条件car
     * @return
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
    List<Car> selectMore(Car car) throws IllegalAccessException,
            SQLException, NoSuchFieldException, InstantiationException ;
}
